package com.wzy.designpattern.creational.prototype.clone;

import java.util.Date;

/**
 * 描述
 * 创建人    Wzy
 * 创建时间: 2020-05-15  20:35
 */
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Date data = new Date(0L);

        Pig pig1 = new Pig("佩奇", data);

        Pig pig2 = (Pig) pig1.clone();

        System.out.println(pig1);
        System.out.println(pig2);

        pig1.getBirthday().setTime(5555555l);
        System.out.println(pig1);
        System.out.println(pig2);
    }
}
